<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>兑换券管理管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/crab/coupon/">兑换券管理列表</a></li>
		<shiro:hasPermission name="crab:coupon:form"><li><a href="${ctx}/crab/coupon/form">兑换券管理添加</a></li></shiro:hasPermission>
	</ul>
	<shiro:hasPermission name="crab:coupon:edit">
	<form:form id="searchForm" modelAttribute="coupon" action="${ctx}/crab/coupon/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>兑换券名称：</label>
				<form:input path="name" htmlEscape="false" maxlength="32" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	</shiro:hasPermission>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>兑换券名称</th>
				<th>商品名称</th>
				<th>价格</th>
				<th>卡号规则</th>
				<th>总数量</th>
				<th>已激活已使用数量</th>
				<th>未激活未使用数量</th>
				<th>已激活未使用数量</th>
				<th>生成日期</th>
				<th>备注</th>
				<shiro:hasPermission name="crab:coupon:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="coupon">
			<tr>
				<td>
					${coupon.name}
				</td>
				<td>
					${coupon.productName}
				</td>
				<td>
					${coupon.price}
				</td>
				<td>
					${coupon.cardNumRule}
				</td>
				<td>
					${coupon.num}
				</td>
				<td>
					${coupon.activateUserNum}
				</td>
				<td>
					${coupon.unActivateUnUserNum}
				</td>
				<td>
					${coupon.activateUnUserNum}
				</td>
				<td>
					<fmt:formatDate value="${coupon.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${coupon.remarks}
				</td>
				<shiro:hasPermission name="crab:coupon:edit">
				<td>
    				<shiro:hasPermission name="crab:coupon:delete"><a href="${ctx}/crab/coupon/delete?id=${coupon.id}" onclick="return confirmx('确认要删除该兑换券管理吗？', this.href)">删除</a></shiro:hasPermission>
					<shiro:hasPermission name="crab:coupon:form"><a href="${ctx}/crab/couponDetail/list?couponId=${coupon.id}&couponName=${coupon.name}">查看兑换券</a></shiro:hasPermission>
				</td>
				</shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>